prefix=/usr/local
exec_prefix=$(prefix)
bin_dir=$(prefix)/bin

HOME_DIR=~
HOME_GRABOVA=$(HOME_DIR)/.grabova
GRABOVA_CONFIG_FILE=$(HOME_GRABOVA)/grabova.ini
GRABOVA_CONFIG_MY_SHOWS_FILE=$(HOME_GRABOVA)/shows.ini
DEST=$(exec_prefix)/grabova

default:
	echo "Targets available : install, uninstall."

install:
	mkdir -p $(HOME_GRABOVA)
	mkdir -p $(DEST)
	cp -r ./src/* $(DEST)
	echo "#!/bin/sh" > $(bin_dir)/grabova
	echo "python $(DEST)/grabova.py $0 $1 $2 $3 $4 $5 $6 $7 $8 $8" >> $(bin_dir)/grabova
	chmod a+x $(bin_dir)/grabova
	if ! test -f $(GRABOVA_CONFIG_FILE) ; then echo "" >> $(GRABOVA_CONFIG_FILE) ; fi;
	if ! test -f $(GRABOVA_CONFIG_MY_SHOWS_FILE) ; then echo "" >> $(GRABOVA_CONFIG_MY_SHOWS_FILE) ; fi;

uninstall:
	rmdir -fr $(HOME_GRABOVA)
	rm $(bin_dir)/grabova
	rmdir -fr $(DEST)
